package meterMonitor.lww;

import meterMonitor.model.MonitorDetail;

import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class LwwTest {


        public static void main(String[] args) throws ParseException {
            SimpleDateFormat sdf6 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

            MonitorDetail monitorDetail=null;
            String startTime="2021-08-29 00:00:00";
            String endTime="2021-08-29 23:59:59";

            Calendar start = Calendar.getInstance();
            start.setTime(sdf6.parse(startTime));
            Calendar end = Calendar.getInstance();
            end.setTime(sdf6.parse(endTime));
            String detailDate11=null;


            long startTimex=System.currentTimeMillis(); //获取开始时间
            while (start.getTimeInMillis() <= end.getTimeInMillis()) {
                //将一天的时间分成十分钟段

                detailDate11=sdf6.format(start.getTime());
                // dates.add(sdf6.format(start.getTime()));
                start.add(Calendar.MINUTE, 10);
                System.out.println(detailDate11.toString());

            }
            long endTimex=System.currentTimeMillis(); //获取结束时间

            System.out.println("1104:::： "+(endTimex-startTimex)+"ms");





        }

}
